package com.example.qixin0314;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import cn.leancloud.LCUser;

public class SetActivity extends AppCompatActivity {

    private ImageView setImage;
    private Button goodbey;
    LCUser currentUser;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set);
        initView();
        Agoodbey();
    }
   private void initView(){
       setImage=findViewById(R.id.set_image);
       goodbey=findViewById(R.id.goodbey);
       setImage.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               SetActivity.this.finish();
           }
       });
    }
    private void Agoodbey(){
        goodbey.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LCUser.logOut();
                Intent intent=new Intent(SetActivity.this,OneActivity.class);
                startActivity(intent);
                Toast.makeText(SetActivity.this,"你已退出登录",Toast.LENGTH_SHORT).show();
            }
        });

    }
}